home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{217F60B4-4487-11D1-9976-400097037212}#1.0#0"; "Keymaster.ocx"
- Begin VB.Form frmDemo
- Caption = "Keymaster Demonstration"
- ClientHeight = 7755
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 10650
- Icon = "frmDemo.frx":0000
- LinkTopic = "Form1"
- ScaleHeight = 7755
- ScaleWidth = 10650
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton Command1
- Height = 255
- Left = 4560
- TabIndex = 24
- Top = 3000
- Width = 375
- End
- Begin VB.CommandButton cmdViewRegistry
- Height = 255
- Left = 4560
- TabIndex = 22
- Top = 2520
- Width = 375
- End
- Begin VB.CommandButton cmdSeeValue
- Height = 255
- Left = 4560
- TabIndex = 21
- Top = 2040
- Width = 375
- End
- Begin VB.CommandButton cmdDeleteValue
- Height = 255
- Left = 4560
- TabIndex = 18
- Top = 1560
- Width = 375
- End
- Begin VB.CommandButton cmdSetValue
- Height = 255
- Left = 4560
- TabIndex = 16
- Top = 1080
- Width = 375
- End
- Begin VB.CommandButton cmdDeleteKey
- Height = 255
- Left = 4560
- TabIndex = 14
- Top = 600
- Width = 375
- End
- Begin VB.CommandButton cmdCreateKey
- Height = 255
- Left = 4560
- TabIndex = 12
- Top = 120
- Width = 375
- End
- Begin VB.TextBox txtValue
- Height = 375
- Left = 1560
- TabIndex = 6
- Top = 3060
- Width = 2415
- End
- Begin VB.TextBox txtValueName
- Height = 405
- Left = 1560
- TabIndex = 5
- Top = 2469
- Width = 2415
- End
- Begin VB.TextBox txtSubkey
- Height = 405
- Left = 1560
- TabIndex = 4
- Top = 1893
- Width = 2415
- End
- Begin VB.TextBox txtRootKey
- Height = 405
- Left = 1560
- TabIndex = 3
- Top = 1317
- Width = 2415
- End
- Begin VB.TextBox txtReturnValue
- Height = 405
- Left = 1560
- TabIndex = 2
- Top = 720
- Width = 2415
- End
- Begin VB.TextBox txtLastError
- Height = 375
- Left = 1560
- TabIndex = 1
- Top = 120
- Width = 2415
- End
- Begin KEYMASTERLib.KeyMaster KeyMaster1
- Left = 120
- Top = 7080
- _Version = 65536
- _ExtentX = 661
- _ExtentY = 661
- _StockProps = 0
- End
- Begin VB.Label Label13
- Caption = "Exit"
- Height = 255
- Left = 5160
- TabIndex = 25
- Top = 3000
- Width = 1215
- End
- Begin VB.Label Label12
- Caption = "View Registry"
- Height = 255
- Left = 5160
- TabIndex = 23
- Top = 2520
- Width = 1215
- End
- Begin VB.Label Label11
- Caption = "View Value"
- Height = 255
- Left = 5160
- TabIndex = 20
- Top = 2040
- Width = 1215
- End
- Begin VB.Label Label10
- Caption = "Delete Value"
- Height = 255
- Left = 5160
- TabIndex = 19
- Top = 1560
- Width = 1215
- End
- Begin VB.Label Label9
- Caption = "Set Value"
- Height = 255
- Left = 5160
- TabIndex = 17
- Top = 1080
- Width = 1215
- End
- Begin VB.Label Label8
- Caption = "Delete Key"
- Height = 255
- Left = 5160
- TabIndex = 15
- Top = 600
- Width = 1215
- End
- Begin VB.Label Label7
- Caption = "Create Key"
- Height = 255
- Left = 5160
- TabIndex = 13
- Top = 120
- Width = 1215
- End
- Begin VB.Label Label6
- Caption = "Value:"
- Height = 255
- Left = 120
- TabIndex = 11
- Top = 3120
- Width = 1215
- End
- Begin VB.Label Label5
- Caption = "Value Name:"
- Height = 255
- Left = 120
- TabIndex = 10
- Top = 2544
- Width = 1215
- End
- Begin VB.Label Label4
- Caption = "Subkey:"
- Height = 255
- Left = 120
- TabIndex = 9
- Top = 1968
- Width = 1215
- End
- Begin VB.Label Label3
- Caption = "Root Key:"
- Height = 255
- Left = 120
- TabIndex = 8
- Top = 1392
- Width = 1215
- End
- Begin VB.Label Label2
- Caption = "Return Value:"
- Height = 255
- Left = 120
- TabIndex = 7
- Top = 816
- Width = 1095
- End
- Begin VB.Label Label1
- Caption = "Last Error:"
- Height = 255
- Left = 120
- TabIndex = 0
- Top = 240
- Width = 855
- End
- Attribute VB_Name = "frmDemo"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Function Switch(TextVal As String) As Long
- Select Case TextVal
- Case "HKEY_CLASSES_ROOT"
- Switch = HKEY_CLASSES_ROOT
- Case "HKEY_CURRENT_USER"
- Switch = HKEY_CURRENT_USER
- Case "HKEY_LOCAL_MACHINE"
- Switch = HKEY_LOCAL_MACHINE
- Case "HKEY_USERS"
- Switch = HKEY_USERS
- Case "HKEY_PERFORMANCE_DATA"
- Switch = HKEY_PERFORMANCE_DATA
- Case "HKEY_CURRENT_CONFIG"
- Switch = HKEY_CURRENT_CONFIG
- Case "HKEY_DYN_DATA"
- Switch = HKEY_DYN_DATA
- End Select
- End Function
- Private Sub cmdCreateKey_Click()
- Dim RetVal As Long
- KeyMaster1.RootKey = Switch(txtRootKey.Text)
- KeyMaster1.SubKey = txtSubkey.Text
- RetVal = KeyMaster1.CreateKey
- txtReturnValue = Trim(Str(RetVal))
- txtLastError.Text = KeyMaster1.LastError
- End Sub
- Private Sub cmdDeleteKey_Click()
- Dim RetVal As Long
- KeyMaster1.RootKey = Switch(txtRootKey.Text)
- KeyMaster1.SubKey = txtSubkey.Text
- RetVal = KeyMaster1.DeleteKey
- txtReturnValue.Text = Trim(Str(RetVal))
- txtLastError.Text = KeyMaster1.LastError
- End Sub
- Private Sub cmdDeleteValue_Click()
- Dim RetVal As Long
- KeyMaster1.RootKey = Switch(txtRootKey.Text)
- KeyMaster1.SubKey = txtSubkey.Text
- KeyMaster1.ValueName = txtValueName.Text
- KeyMaster1.Value = txtValue.Text
- RetVal = KeyMaster1.DeleteValue
- txtReturnValue.Text = Trim(Str(RetVal))
- txtLastError.Text = KeyMaster1.LastError
- End Sub
- Private Sub cmdSeeValue_Click()
- Dim RetVal As Long
- KeyMaster1.RootKey = Switch(txtRootKey.Text)
- KeyMaster1.SubKey = txtSubkey.Text
- KeyMaster1.ValueName = txtValueName.Text
- KeyMaster1.Value = txtValue.Text
- RetVal = KeyMaster1.GetValue
- txtReturnValue.Text = Trim(Str(RetVal))
- txtLastError.Text = KeyMaster1.LastError
- txtValue.Text = KeyMaster1.Value
- End Sub
- Private Sub cmdSetValue_Click()
- Dim RetVal As Long
- KeyMaster1.RootKey = Switch(txtRootKey.Text)
- KeyMaster1.SubKey = txtSubkey.Text
- KeyMaster1.ValueName = txtValueName.Text
- KeyMaster1.Value = txtValue.Text
- RetVal = KeyMaster1.SetValue
- txtReturnValue.Text = Trim(Str(RetVal))
- txtLastError.Text = KeyMaster1.LastError
- End Sub
- Private Sub cmdViewRegistry_Click()
- Shell ("regedit")
- End Sub
- Private Sub Command1_Click()
- Unload Me
- End Sub
-